#include "log4cpp.h"

// log4cplus::Logger logger = Logger::getInstance(LOG4CPLUS_TEXT( "hldlogger" ));

log4cplus::Logger logger_trace = Logger::getInstance(LOG4CPLUS_TEXT("hldlogger"));
log4cplus::Logger logger_debug = Logger::getInstance(LOG4CPLUS_TEXT("hldlogger"));
log4cplus::Logger logger_info = Logger::getInstance(LOG4CPLUS_TEXT("hldlogger"));
log4cplus::Logger logger_warn = Logger::getInstance(LOG4CPLUS_TEXT("hldlogger"));
log4cplus::Logger logger_error = Logger::getInstance(LOG4CPLUS_TEXT("hldlogger"));
log4cplus::Logger logger_fatal = Logger::getInstance(LOG4CPLUS_TEXT("hldlogger"));

Log4cpp *Log4cpp::_instance = nullptr;
Log4cpp::Destroy Log4cpp::destroy;

Log4cpp *Log4cpp::Instance()
{
    if (_instance == nullptr)
    {
        _instance = new Log4cpp();
    }
    return _instance;
}

// Log4cpp::Log4cpp()
// {
// }

// Log4cpp::~Log4cpp()
// {
//     // HLD_LOG4CPLUS_FATAL("==Over==");
//     // printf("[%s:%d]==Over==\n", __FILE__, __LINE__);
// }

// Log4cpp::Log4cpp(const Log4cpp &)
// {
// }

// Log4cpp &Log4cpp::operator=(const Log4cpp &)
// {
// }

void Log4cpp::setConfigurationItems()
{
    try
    {
        ConfigureAndWatchThread configureThread(LOG4CPLUS_TEXT("./config/log.config"), 5 * 1000);
    }
    catch (...)
    {
    }
}
